home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1997 August / Walnut Creek CDROM.7z / VOL_400 / 460_01 / YACL0160.ZIP / uidemo / cursor / main.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-29  |  1.4 KB  |  48 lines

  1.  
  2. // A demo of cursor changes using YACL
  3. //
  4. // M. A. Sridhar
  5. // April 3, 1994
  6.  
  7. #include "ui/composit.h"
  8. #include "ui/applic.h"
  9. #include "ui/pushbtn.h"
  10. #include "ui/cursor.h"
  11.  
  12. int UI_Application::Main (int, char*[])
  13. {
  14.     // This program demonstrates that, under MS-Windows, message objects
  15.     // (i.e., "static" objects) will not be sent mouse move events!
  16.     UI_CompositeVObject* root = new UI_CompositeVObject
  17.         (NULL, NULL, FALSE, UI_Rectangle (50, 50, 230, 400));
  18.     MakeTopWindow (root);
  19.     root->Title () = "YACL Cursor demo";
  20.     
  21.     UI_PushButton* m1 = new UI_PushButton
  22.         (root, UI_Rectangle (10, 10, 200, 50));
  23.     (m1->Model()) = CL_String ("I use an i-beam cursor");
  24.     m1->Cursor() = UICursor_IBeam;
  25.     
  26.     UI_PushButton* m2 = new UI_PushButton
  27.         (root, UI_Rectangle (10, 100, 200, 50));
  28.     (m2->Model()) = CL_String ("I use a wait cursor");
  29.     m2->Cursor() = UICursor_Wait;
  30.     
  31.     UI_PushButton* m3 = new UI_PushButton
  32.         (root, UI_Rectangle (10, 200, 200, 50));
  33.     (m3->Model()) = CL_String ("I use a cross-hair cursor");
  34.     m3->Cursor() = UICursor_CrossHairs;
  35.     
  36. #if defined(__MS_WINDOWS__) || defined(__MS_WIN32__)
  37.     UI_PushButton* m4 = new UI_PushButton
  38.         (root, UI_Rectangle (10, 300, 200, 50));
  39.     (m4->Model()) = CL_String ("I use a custom cursor");
  40.     m4->Cursor() = "SampleCursor";
  41. #endif
  42.     
  43.     Run();
  44.     return 0;
  45. }
  46.  
  47.  
  48.